/**
 * @description  : 公共服务类接口
 * @descriptionDetail : 公共服务类接口
 * @copyright    : 浙江烟草
 * @author       : mc
 * @create       : 2022-10-03 15:19:41
 */

import apiUrl from '@/common/api_urls/common/index';
import reqHelper from '@/common/reqHelper';
import store from '../../store';
import queryParams from '@/uview-ui/libs/function/queryParams.js';
import { DOC_PATH_CONFIG } from '@/common/doc_path.config.js';

/**
 * 替换一下docUrl
 * @param docCode
 * @param url
 * @returns {*}
 */
function replaceDocCode(docCode, url, urlParam, sys) {
	url = url.replace('{x}', docCode);
	if (!urlParam) {
		return url;
	}
	let p = url.indexOf('?') > -1;
	// url 无参数去掉？号 2024-7-10 fsx 开始
	let keys = Object.keys(urlParam);
	  if (!p && keys.length > 0) {
		url = url + '?';
	}
	// url 无参数去掉？号 2024-7-10 fsx 结束
	for (let name in urlParam) {
		let p = urlParam[name];
		if (name == 'approveDate' || name == 'approveInfo') {
			p = encodeURIComponent(p);
		}
		url = url + name + '=' + p + '&';
	}
	let path = DOC_PATH_CONFIG[sys];
	// 去掉多余斜杠 2024-7-10 fsx 开始
	url = url.replace('{sys}/', path);
	// 去掉多余斜杠 2024-7-10 fsx 结束
	
	// 去掉最后一个& 2024-7-10 fsx 开始
	let endStr = url.substr(url.length - 1, 1);
	 if (endStr === '&') {
	    url = url.substr(0, url.length - 1);
	}
	// 去掉最后一个& 2024-7-10 fsx 结束
	return url;
}

export default {
	loadAllDicts() {
		return reqHelper.get({}, apiUrl.common.bscCodesAll);
	},
	getCurrUserInfo() {
		let self = this;
		return new Promise((resolve, reject) => {
			if (store.state.userInfo == undefined) {
				let user = uni.getStorageSync('user');
				store.state.userInfo = user;
				resolve(user);
			} else {
				resolve(store.state.userInfo);
			}
		});
	},
	saveUserInfo(user) {
		let self = this;
		return new Promise((resolve, reject) => {
			store.state.userInfo = user;
			uni.setStorageSync('user', user);
			resolve();
		});
	},
	/**
	 * 查询专卖机构信息
	 * @param {*} parentUuid    父节点
	 * @param {*} treeType      类型：zm-pq专卖片区    zm-case
	 * @returns
	 */
	orgTree(parentUuid, treeType) {
		return reqHelper.postForm(
			{
				parentUuid: parentUuid,
				treeType: treeType,
			},
			apiUrl.common.orgTree
		);
	},
	/**
	 * 组织机构和用户
	 * @param {*} parentUuid    父节点
	 * @param {*} treeType      类型：zm-case
	 * @param {*} ext  其他参数 Object
	 * @returns
	 */
	userTree(parentUuid, treeType, ext) {
		let obj = {
			treeType: treeType,
		};
		if (parentUuid != undefined) {
			obj.parentUuid = parentUuid;
		}
		if (ext) {
			obj = Object.assign(obj, ext);
		}
		return reqHelper.postForm(obj, apiUrl.common.userTree);
	},
	/**
	 * 当前用户是否参与快办试运行
	 * @param {*} jobName
	 * @param {*} deptUuid
	 * @param {*} subKey
	 * @returns
	 */
	scheduleRun(jobName, deptUuid, subKey) {
		return reqHelper.postForm(
			{
				jobName: jobName,
				deptUuid: deptUuid,
				subKey: subKey,
			},
			apiUrl.common.scheduleRun
		);
	},

	/**
	 * 获取行政区域(省市区)list
	 * @returns
	 */
	area() {
		if (store.state.areas) {
			return;
		}
		reqHelper.get({}, apiUrl.common.areaList).then((dr) => {
			if (dr.success) {
				store.state.areas = dr.data;
				uni.setStorageSync('areas', JSON.stringify(dr.data));
				let tmpArrs = dr.data;
				let provs = tmpArrs.filter((itm) => {
					return itm.areaLevel == '01';
				});
				tmpArrs = tmpArrs.filter((itm) => {
					return itm.areaLevel != '01';
				});
				let citys = [];
				for (let i = 0; i < provs.length; i++) {
					citys.push(
						tmpArrs.filter((itm) => {
							return itm.areaLevel == '02' && itm.proCode == provs[i].areaCode;
						})
					);
				}
				tmpArrs = tmpArrs.filter((itm) => {
					return itm.areaLevel != '02';
				});
				let countrys = [];
				for (let i = 0; i < provs.length; i++) {
					let tmpP = [];
					let tmpCity = citys[i];
					for (let j = 0; j < tmpCity.length; j++) {
						tmpP.push(
							tmpArrs.filter((itm) => {
								return itm.areaLevel == '03' && itm.admdivCode == tmpCity[j].areaCode;
							})
						);
					}
					countrys.push(tmpP);
				}
				const lastObj = {};
				dr.data.forEach((item1) => {
					if (item1.areaLevel == '01') {
						lastObj[item1.areaCode] = item1.areaName;
					} else if (item1.areaLevel == '02') {
						lastObj[item1.areaCode] = item1.proName + item1.areaName;
					} else if (item1.areaLevel == '03') {
						lastObj[item1.areaCode] = item1.proName + item1.admdivName + item1.areaName;
					}
				});

				store.state.provs = provs;
				store.state.citys = citys;
				store.state.countrys = countrys;
				store.state.areaObj = lastObj;
			}
		});
	},

	getPersonLocal(code, isAsync = false) {
		if (isAsync) {
			let areas;
			try {
				areas = store.state.areas;
			} catch (e) {
				console.log(e);
			}
			if (areas) {
				for (let i = 0; i < areas.length; i++) {
					if (areas[i].areaCode == code) {
						return areas[i];
					}
				}
				return {};
			} else {
				return {};
			}
		} else {
			return new Promise((resolve, reject) => {
				let areas;
				try {
					areas = store.state.areas;
				} catch (e) {
					console.log(e);
				}
				if (areas) {
					for (let i = 0; i < areas.length; i++) {
						if (areas[i].areaCode == code) {
							resolve(areas[i]);
						}
					}
				} else {
					reject();
				}
			});
		}
	},

	/**
	 * 高德区划转项目区划
	 * 高德区划特性： 直辖市返回值 只有省和 区名  市为“”
	 * @param {*} provinceNames   省名
	 * @param {*} cityNames  市名
	 * @param {*} aNames  区名
	 * @returns
	 */
	getLocalName(provinceNames, cityNames, aNames) {
		if (!store.state.areas) {
			return {};
		}
		if (provinceNames == '重庆市' || provinceNames == '北京市' || provinceNames == '天津市' || provinceNames == '上海市') {
			cityNames = provinceNames;
			provinceNames = provinceNames.substr(0, 2);
		}
		let areas = store.state.areas;
		for (let i = 0; i < areas.length; i++) {
			// name = areas[i]
			if (areas[i].proName == provinceNames && areas[i].admdivName == cityNames && areas[i].areaName == aNames) {
				return areas[i];
			}
		}
		return {};
	},

	/**
	 * 记录钉钉移动端日志
	 * @returns {Promise<any>}
	 */
	dingLog(bizUuid, moduleType, optType, optDesc, remark) {
		let obj = {
			bizUuid: bizUuid,
			moduleType: moduleType,
			optType: optType,
			optDesc: optDesc,
			remark: remark,
		};
		return  reqHelper.get(obj, apiUrl.common.dingLog);
	},

	/**
	 * 获取街道列表
	 * @param {Object} areaCode
	 */
	getStreetsList(areaCode) {
		return  reqHelper.get(
			{
				areaCode: areaCode,
			},
			apiUrl.common.streets
		);
	},

	/**
	 * 卷烟列表查询
	 * @param {*} page
	 * @param {*} limit
	 * @param {*} paras
	 * @returns
	 */
	getCigarList(page, limit, paras) {
		return reqHelper.postForm(
			{
				page: page,
				limit: limit,
				...paras,
			},
			apiUrl.common.cigarList
		);
	},

	/**
	 * 获取社区列表
	 * @param {Object} areaCode
	 */
	getVillagesList(areaCode) {
		return  reqHelper.get(
			{
				areaCode: areaCode,
			},
			apiUrl.common.villages
		);
	},
	/**
	 * 获取当月第一天和最后一天
	 */
	currentMonthDays() {
		return  reqHelper.get({}, apiUrl.common.currentMonthDays);
	},

	/**
	 * 获取当前周的第一天和最后一天
	 */
	currentWeekDays() {
		return  reqHelper.get({}, apiUrl.common.currentWeekDays);
	},
	/**
	 * 获取当前周的第一天和最后一天
	 * @param orguuid
	 */
	getOrgs(code) {
		return reqHelper.get(
			{
				orgUuids: code,
			},
			apiUrl.common.orgs,
			'POST',
			'application/x-www-form-urlencoded'
		);
	},
	bscCodesMap(bctPhNames) {
		return reqHelper.postForm(
			{
				bctPhNames: bctPhNames,
			},
			apiUrl.common.bscCodesMap
		);
	},
	getBizOrgs(orgUuids) {
		return reqHelper.postForm(
			{
				treeType: 'zm-gls',
				orgUuids: orgUuids,
			},
			apiUrl.common.getBizOrgs
		);
	},

	/**
	 * 附件预览地址
	 * @param {Object} imgUrl
	 */
	getViewImgUrl(imgUrl) {
		let tk = uni.getStorageSync('tk');
		return apiUrl.common.viewImgUrl + '?tk=' + tk + '&imgUrl=' + encodeURIComponent(imgUrl);
	},
	/**
	 * 附件下载地址
	 * @param {Object} fileId
	 */
	getDownloadFileUrl(fileId) {
		let tk = uni.getStorageSync('tk');
		return apiUrl.common.downloadFile + '?tk=' + tk + '&fileId=' + fileId;
	},
	/**
	 * 查询业务附件
	 * @param {Object} bizId
	 * @param {Object} group
	 */
	goFiles(bizId, group) {
		return reqHelper.get(
			{
				bizId: bizId,
				group: group,
				menuCode: null,
			},
			apiUrl.common.findFilesByBizIdAndGroup
		);
	},

	/**
	 * 上传base64编码文件
	 * @param {Object} base64Data
	 * @param {Object} param  {bizId,fileName,fiGroupCode,fiLogicPath}
	 */
	uploadBase64ForApp(base64Data, param) {
		let sp = `?bizId=${param.bizId}&fileName=${param.fileName}&fiGroupCode=${param.fiGroupCode}&fiLogicPath=${param.fiLogicPath}`;
		base64Data = base64Data.indexOf(',') ? base64Data.split(',')[1] : base64Data;
		return reqHelper.postJson(
			{
				base64Data: base64Data,
			},
			apiUrl.common.uploadBase64ForApp + sp
		);
	},

	/**
	 * 删除附件
	 * @param {Object} fileId
	 */
	delFile(fileId) {
		return reqHelper.get(
			{
				fileId: fileId,
			},
			apiUrl.common.deleteFile
		);
	},

	/**
	 * 上传base64编码文件
	 * @param {Object} param  {base64Data,fileName,fiGroupCode}
	 */
	uploadBase64File(param) {
		let base64 = param.base64Data;
		delete param.base64Data;
		let sp = queryParams(param);
		return reqHelper.postJson(base64, apiUrl.common.uploadBase64 + sp);
	},

	/**
	 * 切换部门
	 * @param {Object} param
	 */
	switchDept(param) {
		let headers = {};
		headers['Content-Type'] = 'application/x-www-form-urlencoded; charset=UTF-8';
		headers['Accept'] = 'application/json,text/javascript,*/*;q=0.01';
		
		return reqHelper.get(param, apiUrl.common.switchDept, headers);
	},
	/**
	 * 查询附近采集的点位
	 * @param {Object} marketGis
	 */
	getNearBy(marketGis) {
		return reqHelper.postForm(marketGis, apiUrl.poi.getNearBy);
	},
	/**
	 * 添加零售户gis坐标关联
	 * @param {*} retailerUuid
	 * @param {*} gisUuid
	 * @returns
	 */
	addLicMarketGis(retailerUuid, gisUuid, retailDistance) {
		return reqHelper.postForm(
			{
				retailerUuid: retailerUuid,
				gisUuid: gisUuid,
				isAuto: 0,
				retailDistance: retailDistance,
			},
			apiUrl.poi.addLicMarketGis
		);
	},
	/**
	 * 查询零售户关联的坐标
	 * @param {*} retailerUuid
	 * @param {*} gisSubtype 指定类型的关联坐标
	 * @returns
	 */
	getRetailerLicGis(retailerUuid, gisSubtype) {
		return reqHelper.get(
			{
				retailerUuid: retailerUuid,
				gisSubtype: gisSubtype,
			},
			apiUrl.poi.getRetailerLicGis
		);
	},
	/**
	 * 删除零售户关联的坐标
	 * @param {*} gisLicUuid
	 * @returns
	 */
	delLicMarketGis(gisLicUuid) {
		return reqHelper.postForm(
			{
				gisLicUuid: gisLicUuid,
			},
			apiUrl.poi.delLicMarketGis
		);
	},
	/**
	 * 更新或删除点位信息
	 * @param {Object} marketGis
	 */
	modifyLocation(marketGis) {
		return reqHelper.postJson(marketGis, apiUrl.poi.modifyLocation);
	},
	/**
	 * 点位采集类型树
	 * @param {Object} marketGis
	 */
	gisTypeTree() {
		return reqHelper.get({}, apiUrl.poi.gisTypeTree);
	},
	/**
	 * 保存采集的点位信息
	 */
	saveLocation(marketGis) {
		return reqHelper.postJson(marketGis, apiUrl.poi.saveLocation);
	},
	/**
	 * 获取行政区划信息(省市区)
	 * @returns
	 */
	getAreaTreeAll() {
		return reqHelper.postForm({}, apiUrl.common.getAreaTreeAll);
	},
	/**
	 * 检查行为数据分页查询
	 * @param {*} page
	 * @param {*} limit
	 * @param {*} paras dealType：10210021,简易案件,10210022,一般案件；licNo
	 * @returns
	 */
	jgsxCheckLst(page, limit, paras) {
		return reqHelper.postJson(
			{
				page: page,
				limit: limit,
				...paras,
			},
			apiUrl.common.jgsxCheckLst
		);
	},
	/**
	 * 查询指定零售户一般案件检查行为数据
	 * @param {*} licNo
	 * @returns
	 */
	jgsxCheckInfo(licNo, page = 1, limit = 1) {
		//   10210022   y一般案件   10210021 简易案件
		return reqHelper.postJson(
			{
				page: page,
				limit: limit,
				licNo: licNo,
				dealType: '10210022',
			},
			apiUrl.common.jgsxCheckLst
		);
	},
	/**
	 * 查询卷烟图片
	 */
	searchCigarImgs(productUuid) {
		return reqHelper.get(
			{
				productUuid: productUuid,
			},
			apiUrl.common.searchCigarImgs
		);
	},
	/**
	 * 模糊查询省市区
	 */
	queryAreaBaseList(searchTxt) {
		return reqHelper.postForm(
			{
				areaName: searchTxt,
				page: 1,
				limit: 10,
			},
			apiUrl.common.queryAreaBaseList
		);
	},
	/**
	 * 通过地区code查询
	 */
	getAreaByCountryCode(countryCode) {
		return reqHelper.postForm(
			{
				countryCode: countryCode,
			},
			apiUrl.common.getAreaByCountryCode
		);
	},
	/**
	 * 获取图片文件信息
	 */
	getFiles(bizUuid) {
		return reqHelper.postForm(
			{
				bizUuid: bizUuid,
			},
			apiUrl.common.getFiles
		);
	},
	/**
	 * 根据key获取字典内容
	 */
	getBscCodes(bctPhName) {
		return reqHelper.get(
			{
				bctPhName: bctPhName,
			},
			apiUrl.common.getBscCodes
		);
	},
	bscCodesTree(bctPhName) {
		return reqHelper.get(
			{
				bctPhName: bctPhName,
			},
			apiUrl.common.bscCodesTree
		);
	},
	// 根据业务id查询附件列表
	findFileByFileId(fileId) {
		return reqHelper.get(
			{
				fileId: fileId,
			},
			apiUrl.common.findFileByFileId
		);
	},
	// 根据业务id查询附件列表
	findBscAreaStreetByAreaUuid(params) {
		return reqHelper.get(params, apiUrl.common.findBscAreaStreetByAreaUuid);
	},
	/**
	 * 获取省的列表
	 */
	provinces() {
		return reqHelper.get({}, apiUrl.common.provinces);
	},
	/**
	 * 获取市的列表
	 */
	cities(proCode) {
		return reqHelper.get(
			{
				proCode: proCode,
			},
			apiUrl.common.cities
		);
	},
	/**
	 * 获取区县
	 * @param {Object} orgUuid
	 */
	countries(cityCode) {
		return reqHelper.get(
			{
				cityCode: cityCode,
			},
			apiUrl.common.countries
		);
	},
	/**
	 * 根据orgId获取区
	 */
	getAcceptAreaList(orgUuid) {
		return reqHelper.get(
			{
				orgUuid: orgUuid,
			},
			apiUrl.common.getAcceptAreaList
		);
	},
	/**
	 * 获取移动端模块权限
	 */
	getMobileModuleAuth() {
		return reqHelper.get({}, apiUrl.common.getMobileModuleAuth);
	},
	/**
	 * 页日志保存
	 * @param {Object} param
	 */
	savePageLog(param) {
		return reqHelper.postJson(param, apiUrl.common.savePageLog);
	},
	/**
	 * 查询日志保存
	 * @param {Object} param
	 */
	saveQueryLog(param) {
		return reqHelper.postJson(param, apiUrl.common.saveQueryLog);
	},
	/**
	 * 根据部门id查询所属区划
	 * @param {Object} orgUuid
	 */
	queryAreaBaseByCode(orgUuid) {
		return reqHelper.get(
			{
				orgUuid: orgUuid,
			},
			apiUrl.common.queryAreaBaseByCode
		);
	},
	/**
	 * 获取系统时间
	 */
	getCurrentTime() {
		// return reqHelper.get({}, apiUrl.common.getCurrentTime);
		return new Promise((resolve, reject) => {
			resolve({
				success: false,
			});
		});
	},
	/**
	 * 行为数据采集
	 * bizType 业务类型字典表\nB001 双随机计划制定-制定计划\nB002 双随机抽取管理-抽取\nB003 任务池管理-添加任务\nB004 月走访计划管理-新增\nB005 日检查计划管理-新增\nB005 日检查计划审批\nB006 市管检查工作\nB007 文书操作\nB008 实地核查
	 * operationType  操作类型 字典表\n保存\n提交\n其他（进一步完善）
	 * terminalType  终端类型\nT001 PC端\nT002 移动端
	 */
	saveBehaviorLog(param) {
		param.terminalType = 'T002';
		return reqHelper.postForm(param, apiUrl.common.saveBehaviorLog);
	},

	saveBehaviorLogBatch(param) {
		if (param && param.length > 0) {
			param.forEach((itm) => {
				itm.terminalType = 'T002';
			});
		}
		return reqHelper.postJson(param, apiUrl.common.saveBehaviorLogBatch);
	},

	// 文书公共接口 start
	/**
	 * 获取文书详情
	 * @param paras 查询参数
	 */
	getDocIns(docInsUuid) {
		return reqHelper.postForm(
			{
				docInsUuid: docInsUuid,
			},
			apiUrl.doc.getDocIns
		);
	},

	/**
	 * 获取文书详情
	 * @param paras 查询参数
	 */
	getById(docUuid) {
		return reqHelper.postForm(
			{
				docUuid: docUuid,
			},
			apiUrl.doc.getById
		);
	},

	docFields(docUuid, canUserDefine) {
		return reqHelper.postForm(
			{
				docUuid: docUuid,
				canUserDefine: canUserDefine,
			},
			apiUrl.doc.docFields
		);
	},
	initOtherMain(param) {
		return reqHelper.postForm(param, apiUrl.doc.initOtherMain);
	},
	/**
	 * 审核审批信息
	 * @param paras 查询参数
	 */
	approves(param) {
		return reqHelper.postForm(param, apiUrl.doc.approves);
	},
	/**
	 * 审批历史
	 * @param paras 查询参数
	 */
	flowHis(param) {
		return reqHelper.postForm(param, apiUrl.doc.flowHis);
	},
	/**
	 * 第三方人员签名
	 * @param {*} docInsUuid    文书实例uuid
	 * @param {*} personName    第三方人员姓名
	 * @param {*} idCardNo      第三方人员身份证号
	 * @returns
	 */
	dsrSign(docInsUuid, personName, idCardNo) {
		return reqHelper.postForm(
			{
				docInsUuid: docInsUuid,
				personName: personName,
				idCardNo: idCardNo,
			},
			apiUrl.doc.dsrSign
		);
	},
	/**
	 * 检查当事人是否已完成签名
	 * @param {*} docInsUuid    文书实例uuid
	 * @returns   success: false已完成签名，true未完成待签
	 */
	isSigned(docInsUuid) {
		return reqHelper.postForm(
			{
				docInsUuid: docInsUuid,
			},
			apiUrl.doc.isSigned
		);
	},

	/**
	 * 根据文书code查询文书配置信息(docCode换docUuid)
	 * @param {Object} docCode
	 */
	getDocConfig(docCode) {
		return reqHelper.postForm(
			{
				docCode: docCode,
			},
			apiUrl.doc.getDocConfig
		);
	},
	/**
	 * 二维码列表分页查询接口
	 * @param param param
	 * @param cPath cPath
	 * @returns {Promise<AxiosResponse<any>>}
	 */
	getDoc(param, cPath, sys) {
		return reqHelper.postForm(param, replaceDocCode(cPath, apiUrl.doc.getDoc, {}, sys));
	},
	/**
	 * 保存文书
	 * @param param
	 * @param cPath cPath
	 */
	saveDoc(param, cPath, urlParam, sys) {
		return reqHelper.postJson(param, replaceDocCode(cPath, apiUrl.doc.saveDoc, urlParam, sys));
	},
	// 获取流程审批人
	getFlowPerson(docInsUuid, stepCode) {
		return reqHelper.postForm(
			{
				docInsUuid: docInsUuid,
				stepCode: stepCode,
			},
			apiUrl.doc.getFlowPerson
		);
	},
	/**
	 * 返回上一步
	 * @param param
	 * @param cPath  cPath
	 */
	disagree(param, cPath, urlParam, sys) {
		return reqHelper.postJson(param, replaceDocCode(cPath, apiUrl.doc.disagree, urlParam, sys));
	},
	/**
	 * 驳回待办
	 * @param param
	 * @param cPath  cPath
	 */
	backToFirst(param, cPath, urlParam, sys) {
		return reqHelper.postJson(param, replaceDocCode(cPath, apiUrl.doc.backToFirst, urlParam, sys));
	},
	/**
	 * 同意待办
	 * @param param
	 * @param cPath  cPath
	 */
	agree(param, cPath, urlParam, sys) {
		return reqHelper.postJson(param, replaceDocCode(cPath, apiUrl.doc.agree, urlParam, sys));
	},
	/**
	 * 提交文书
	 * @param param
	 * @param cPath cPath
	 */
	submit(param, cPath, urlParam, sys) {
		return reqHelper.postJson(param, replaceDocCode(cPath, apiUrl.doc.submitDoc, urlParam, sys));
	},
	/**
	 * 获取审批人信息
	 * @param param
	 * page: 1
	 * limit: 10
	 * gfCode: docRegisterReport
	 * stepCode:
	 * bizId:
	 */
	flowNextPerson(param) {
		return reqHelper.postForm(param, apiUrl.doc.flowNextPerson);
	},
	/**
	 * 工作代办列表
	 * @param {Object} param
	 */
	getMyBizTaskTodoPage(param) {
		return reqHelper.postForm(param, apiUrl.doc.getMyBizTaskTodoPage);
	},
	/**
	 * 工作已办列表
	 * @param {Object} param
	 */
	getMyBizTaskDonePage(param) {
		return reqHelper.postForm(param, apiUrl.doc.getMyBizTaskDonePage);
	},
	/**
	 * 新已核查接口
	 * @param {Object} param
	 */
	getMyBizTaskDoneAllPage(param) {
		return reqHelper.postForm(param, apiUrl.doc.getMyBizTaskDoneAllPage);
	},
	/**
	 * 我发起的列表
	 * @param {Object} param
	 */
	getMyBizTaskStartPage(param) {
		return reqHelper.postForm(param, apiUrl.doc.getMyBizTaskStartPage);
	},
	getBizTaskConfigBybizCode(param) {
		return reqHelper.postForm(param, apiUrl.doc.getBizTaskConfigBybizCode);
	},
	getPageBizTaskConfig(param) {
		return reqHelper.postForm(param, apiUrl.common.getPageBizTaskConfig);
	},
	// 文书公共接口 end
	// 获取非文书审批历史记录
	noDocFlowHis(param) {
		return reqHelper.get(param, apiUrl.common.noDocFlowHis);
	},
	/**
	 * 查询第三方签名预览url地址
	 * @returns
	 */
	getThirdSign() {
		return reqHelper.postForm(
			{
				key: 'THIRD_SIGN',
			},
			apiUrl.common.getSysConfigs
		);
	},
	/**
	 * 查询配置
	 * @param {*} key
	 * @param {*} subKey
	 * @returns config_value存放在msg中
	 */
	getSysConfig(key, subKey) {
		return reqHelper.postForm(
			{
				key: key,
				subKey: subKey,
			},
			apiUrl.common.getSysConfig
		);
	},
	/**
	 * 系统配置列表  bln 11.16
	 * @param {*}limit
	 * @param {*}page
	 * @param {*}configKey
	 * @param {*}configSubKey
	 */
	getSysConfigList(params) {
		return reqHelper.postForm(params, apiUrl.common.getSysConfigList);
	},
	// 举报卷宗审核获取文书信息
	getArchivesApproveList(param) {
		return reqHelper.get(param, apiUrl.doc.getArchivesApproveList);
	},
	// 同意
	saveArchives(param) {
		return reqHelper.postForm(param, apiUrl.doc.saveArchives);
	},
	// 不同意
	// unagreeArchives(param) {
	// 	return reqHelper.postForm(param, apiUrl.doc.unagreeArchives);
	// },
	// 案件卷宗审核获取文书信息
	getCaseApplyList(param) {
		return reqHelper.get(param, apiUrl.doc.getCaseApplyList);
	},
	// 移动端 菜单权限
	getListMenus() {
		return reqHelper.postForm({}, apiUrl.common.getListMenus);
	},
	// 卷宗调阅文书信息
	getRlicApplyList(param) {
		console.log(apiUrl.doc.getRlicApplyList, 111);
		return reqHelper.get(param, apiUrl.doc.getRlicApplyList);
	},
	getCaseApproveList(param) {
		return reqHelper.get(param, apiUrl.doc.getCaseApproveList);
	},
	// 判断几级审批
	getFlowIsFinish(param) {
		return reqHelper.get(param, apiUrl.doc.getFlowIsFinish);
	},
	// 获取合理化布局配置信息
	getGridLayoutInfo(param) {
		return reqHelper.get(param, apiUrl.rsp.getGridLayoutInfo);
	},
	// 流程图
	getFlowImage(param){
		return reqHelper.get(param, apiUrl.doc.getFlowImage);
	}
};
